<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>
<head>
	<title>持有某权限用户列表</title>
	<%@ include file="/common/meta.jsp" %>
    <%@ include file="/common/import.jsp" %>
	<%@ include file="uct-import.jsp" %>
	
	<script>
		var actsAry = "${acts}";//权限

		$(function(){
			$('#userList').datagrid({
				title:'',
				iconCls:'icon-ok',
				url:'${ctx}/uct/act/act-user-list!data.action?actId=${actId}',
				loadMsg:'数据载入中，请稍后……',
				//fit:true,
				nowrap: false,
				striped: true,
				collapsible:false,				
				fitColumns: true,
				pagination:true,
				singleSelect:true,
				rownumbers:true,
				remoteSort: false,
				pageList:[10,20,30,50,100],
				idField:'userId',
				columns:[[
				/**
					{field:'userId',title:'用户Id',width:100,sortable:true,
						sorter:function(a,b){
							return (a>b?1:-1);
						}
					},
				*/
					{field:'userEname',title:'账号',width:100,sortable:true,
						sorter:function(a,b){
							return (a>b?1:-1);
						}
					},
					{field:'userCname',title:'姓名',width:100,sortable:true,
						sorter:function(a,b){
							return (a>b?1:-1);
						}
					},
					{field:'orgEname',title:'所属机构',width:100,sortable:true,
						sorter:function(a,b){
							return (a>b?1:-1);
						}
					},
					{field:'userType',title:'用户类型',width:100,sortable:true,
						sorter:function(a,b){
							return (a>b?1:-1);
						},
						formatter:function(value){
							if( value=='1'){return '机构用户';}
							else if(value=="2"){ return '会员用户';}
							else if(value=="3"){ return '监督方';}
							else{return "";}
						}
					},
					{field:'userStatus',title:'状态',width:100,
						formatter:function(value){
							if( value=='1'){return '启用';}else{ return '停用';}
						}
					}
				]]
			});
			
			 $('#userList').datagrid('getPanel').panel({
								onExpand: function(){
									//$('#userActWin').panel('collapse');
									//$('#userActWin').panel('close');
								}
			});		

		});
		
		
		function reload(){
			$('#userList').datagrid('reload');
		}
		
		
		function searchUser(){					
	    	var queryParams = $('#userList').datagrid('options').queryParams;	       
	        queryParams.userEname = $('#userEname').val();
	        queryParams.userCname = $('#userCname').val();
	        
	        $('#userList').datagrid("reload");
	        $('#query').window('close');
       	}
       
		
		function getSelected(){
			var selected = $('#userList').datagrid('getSelected');
			if (selected){
				return selected;
			}else{
				$.messager.alert('提示', '请选择要操作的数据', 'info');
			}
		}
		
		
		
	</script>
</head>
<body>
	<table class="planel-body" >
		<tr >
			<td>用户账号：</td>
			<td><input type="text" id="userEname" name="userEname" size="20" value="" /></td>
			<td>用户姓名：</td>
			<td><input type="text" id="userCname" name="userCname" size="20" value="" /></td>
			<td><a href="#" class="easyui-linkbutton" iconCls="icon-search" onClick="searchUser();">查找</a></td>	
		</tr>
	</table>
	
	<table id="userList"></table>

</body>
</html>